<?php

/**
 * TYPOlight webCMS
 *
 * The TYPOlight webCMS is an accessible web content management system that
 * specializes in accessibility and generates W3C-compliant HTML code. It
 * provides a wide range of functionality to develop professional websites
 * including a built-in search engine, form generator, file and user manager,
 * CSS engine, multi-language support and many more. For more information and
 * additional TYPOlight applications like the TYPOlight MVC Framework please
 * visit the project website http://www.typolight.org.
 *
 * PHP version 5
 * @copyright  Leo Feyer 2005
 * @author     Leo Feyer <leo@typolight.org>
 * @package    System
 * @license    GPL
 * @filesource
 */

require_once 'DC_Table.php';
/**
 * Class DC_Table
 *
 * Provide methods to modify data stored in a table.
 * @copyright  Leo Feyer 2005
 * @author     Leo Feyer <leo@typolight.org>
 * @package    Controller
 */
class DC_Catalog extends DC_Table
{

    /**
	 * Initialize the object
	 * @param string
	 */
    public function __construct($strTable)
    {
        $this->import('Database');
        $this->import('Input');
            
        $objType = $this->Database->prepare("SELECT tableName, dca FROM tl_catalog_types where id=?")
            ->limit(1)
            ->execute(CURRENT_ID);
            
        if ($objType->dca)
        {
            $dca = unserialize($objType->dca);
        } 
        else
        {
            $this->import('Catalog');
            $dca = $this->Catalog->getDefaultDca();
        }
        
        // load langages
        $GLOBALS['TL_LANG'][$objType->tableName] = $GLOBALS['TL_LANG']['tl_catalog_items'];
        // load dca
        $GLOBALS['TL_DCA'][$objType->tableName] = $dca;
        
        parent::__construct($objType->tableName);
    }
}

?>